<?php
header('Content-Type:text/html; Charset=UTF-8');
require 'lib/checker.php';

@$name = $_REQUEST['name'];

$title = '添加餐桌错误提示';
$jumpUrl = 'boardAdd.php';

if(empty($name)){
	$message = '餐桌号必须填写';
	include 'lib/message.php';
	die;
}

require 'lib/db.php';

@$flag = dbInsert('insert into desk(name) values (:name)',array('name'=>$name));

if(!flag){
	$message = '添加餐桌失败';
	include 'lib/message.php';
	die;
}

header('location:boardList.php');